package cn.zyq.ykb.system.pay.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;


@Component
@ConfigurationProperties(prefix = "pay.wx")
public class PayWxProperties {
    /**
     * 商户号
     */
    public static String mchId;

    /**
     * apiV2 密钥值
     */
    public static String apiV2Key;


    /**
     * apiV3 密钥值
     */
    public static String apiV3Key;
    /**
     * 密钥证书路径
     */
    public static String privateKeyPath;

    /**
     * apiclient_key.pem 证书文件的绝对路径或者以 classpath: 开头的类路径.
     * 对应的字符串
     */
    public static String privateKeyContent;

    /**
     * apiclient_cert.pem 证书文件的绝对路径或者以 classpath: 开头的类路径.
     * 对应的字符串
     * <p>
     */
    public static String privateCertContent;

    /**
     * 支付回调地址
     * 注意，支付渠道统一回调到 payNotifyUrl 地址，由支付模块统一处理；然后，自己的支付模块，在回调 PayAppDO.payNotifyUrl 地址
     */
    public static String payNotifyUrl;
    /**
     * 渠道费率
     */
    public static int feeRate;


    public void setMchId(String mchId) {
        PayWxProperties.mchId = mchId;
    }

    public void setApiV2Key(String apiV2Key) {
        PayWxProperties.apiV2Key = apiV2Key;
    }

    public void setApiV3Key(String apiV3Key) {
        PayWxProperties.apiV3Key = apiV3Key;
    }

    public void setPrivateKeyContent(String privateKeyContent) {
        PayWxProperties.privateKeyContent = privateKeyContent;
    }

    public void setPrivateCertContent(String privateCertContent) {
        PayWxProperties.privateCertContent = privateCertContent;
    }

    public void setPayNotifyUrl(String payNotifyUrl) {
        PayWxProperties.payNotifyUrl = payNotifyUrl;
    }

    public void setFeeRate(int feeRate) {
        PayWxProperties.feeRate = feeRate;
    }

    public void setPrivateKeyPath(String privateKeyPath) {
        PayWxProperties.privateKeyPath = privateKeyPath;
    }
}
